package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class TryCatchDemo02 {
    public static void main(String[] args) throws IOException {
        try {
            FileOutputStream fos = new FileOutputStream("./2407/fos.txt", true);
            fos.write(100);
            fos.close();
           //这里将FileNotFoundExcetpion交给IOException对象进行处理
        } catch (IOException e2) {//当多种类型的异常处理机制相同时，可以合并异常,异常类型为父类类型
           e2.printStackTrace();
       }
    }
}
